<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<style>
			/*企业好友css*/
			
			 .oa-contact-cell.mui-table .mui-table-cell {
				padding: 11px 0;
				vertical-align: middle;
			}
			
			.oa-contact-cell {
				position: relative;
				margin: -11px 0;
			}
	
			.oa-contact-avatar {
				width: 75px;
			}
			.oa-contact-avatar img {
				border-radius: 50%;
			}
			.oa-contact-content {
				width: 100%;
			}
			.oa-contact-name {
				margin-right: 20px;
			}
			.oa-contact-name, .oa-contact-position {
				float: left;
			}
		</style>
	</head>

	<body>
		<div id="qiyePeoplePart" class="mui-page" >
			<div class="mui-navbar-inner mui-bar mui-bar-nav" >
				<a href="organize-list.html" class="mui-left mui-action-back mui-btn  mui-btn-link mui-btn-nav mui-pull-left">
					<span class="mui-icon mui-icon-left-nav"></span>
				</a>
				<h1 class="mui-title">企业好友</h1>
		
			</div>
			<div class="mui-page-content">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll">
			
				<ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">
					<div class="mui-indexed-list-search mui-input-row mui-search">
						<input type="search" class="mui-input-clear mui-indexed-list-search-input" placeholder="搜索好友">
					</div>	
				<div id="EmpList">		
					<!--  员工列表  -->
				</div>
				
			</ul>	
			</div>
				</div>
			</div>
		</div>
		
		
		
		
		
		<script src="js/mui.min.js"></script>
		<script src="js/jquery.min.js"></script>
		<script type="text/javascript">
			mui.init();
			//初始化
			var id=localStorage.getItem("employeeid");
 		mui.plusReady(function() {
				getEmpList();
			});
			
			function getEmpList(){
				var network = true;
				if(mui.os.plus) {
					mui.plusReady(function() {
						if(plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE) {
							network = false;
						}
					});
				}
				if(network) {
						console.log('网络正常,正在发送请求...');
							 mui.ajax({
                                    url:'http://113.71.26.27:8080/tpl/phone/getAllEmp',
                                    async:true,
     								type:'post',
     								data:{
     									empid:id
     								},
     							 	success:function(data){
     							 		
     							 		var emp='';
       									for(var i=0;i<data.length;i++){
       										var eamil='';
     							 		if(data[i].email!=null){
     							 			eamil=data[i].email;
     							 		}
       										var UTFName=encodeURI(encodeURI(data[i].name));//防止中文乱码
       										emp+="<li class='mui-table-view-cell'><a href='single-chat.html?firendsId="+data[i].loginName+"&&firendsName="+UTFName+"'>"+
													"<div class='mui-slider-cell'>"+
														"<div class='oa-contact-cell mui-table'>"+
															"<div class='oa-contact-avatar mui-table-cell'>"+
																"<img style='width:40px;height:40px;' src='http://113.71.26.27:8080/tpl/public/uploadImage/peopleLogo/"+data[i].imgUrl+"' />"+
															"</div>"+
															"<div class='oa-contact-content mui-table-cell'>"+
																"<div class='mui-clearfix'>"+
																	"<h4 class='oa-contact-name'>"+data[i].name+"</h4>"+
																	"<span class='oa-contact-position mui-h6'>"+data[i].job+"</span>"+
																"</div>"+
																"<p class='oa-contact-email mui-h6'>"+eamil+"</p></div></div></div></a></li>";
       									}
       									$('#EmpList').append(emp);
     								}
     						});
				} 
				else {
						mui.toast("当前网络不给力，请稍后再试...");
				}

			}
			
				/**
		 * 重写返回事件
		 */
		mui.back = function(){
			
			window.location.href = "organize-list.html";
		}
	
		</script>
	</body>

</html>